class VoteController < ApplicationController
  
  def create
    @vote = Vote.new
    @vote.picture = Picture.find(params[:vote]['picture_id'])
    @vote.user = User.find(session[:user_id])
    @vote.picture.update_score(params[:vote][:score])
    @vote.save
    respond_to do |format|
	format.html { redirect_to :back }
	format.js
    end
  end
  
end
